package com.ssm.mapper;

import com.ssm.pojo.Record;
import com.ssm.pojo.Book;
import com.ssm.pojo.Guan;
import com.ssm.pojo.Yong;
import org.springframework.stereotype.Repository;
import java.util.List;

@Repository
public interface Guanmapper {
    //查询所有借阅记录
    List<Record> getRecord(Record record);

    int getCount(Record record);

    int getCount2(Record record);
    //允许借阅
    void updateRecord(long id);
    //不允许借阅
    void notAllowRecord(long id);
    //添加未归还书籍
    void insertBackBooks(long id);
    //查看申请归还的书籍
    List<Record> getBackBooks(Record record);
    //同意归还
    void allowBackBook(long id);
    //查询管理员(???)
    Guan getGuan(Yong yong);
    //添加归还书籍数目，先查询出record的id,根据record的bookid得到book的ID
    int selectRecordId(long id);
    int selectBooksId(long id);
    //增加书籍数
    void updateBooks(long id);
    //减少书籍数量
    void descBooks(long id);
    //更新归还时间
    void updateRecordTime(Record record);
    //查询所有图书
    List<Book> getBooks(Book book);
    int getCount(Book book);
    //增加图书
    void addBooks(Book book);
    //查询图书根据id
    Book getBookById(long id);
    //修改图书
    void updateBooks(Book book);
    //删除图书
    void deleteBooks(long id);
    //查询所有用户
    List<Yong> getYong(Yong yong);
    //增加用户
    void addYong(Yong yong);
    //根据id查用户
    Yong getYongById(long idnum);
    //修改用户
    void updateYong(Yong yong);
    //删除用户
    void deleteYong(long id);
    //查询用户是否存在
    int selectYong(String name);
}
